import pandas as pd
# with语句避免忘记关闭文件的情况。
sample=['123','456']
with open('D:/ITaudit/pandas_excel/列表.txt', 'w') as f:
    for i in sample:#对sample中的元素
        f.write(i)
        f.write('\n')

with open('D:/ITaudit/pandas_excel/列表.txt', 'r') as f:
    c = f.readlines()#读取文件内容
# print(c)

# with open(file) as f:#with语句相当于一下两行代码的作用
# f = open(file)
# f.close()

path = r'C:\Users\admin\Desktop\IT审计书\运费分类汇总\运费明细表.xlsx'
df01 = pd.read_excel(path,sheet_name="运费明细")
print(type(df01['应收费用']))
df03 = df01.groupby(['出口日期'])['应收费用'].sum()
print(df03)